
import request from "@/utils/request";
//引入类型
import type { AllHospital,HospitalLevelData,HospitalInfo } from "./type"; 
//枚举接口
enum API {
    //获取已有医院的数据
    HOSPITAL_URL = '/hosp/hospital/',
    //获取医院等级和地区接口
    HOSPITAL_LEVEL_URL = '/cmn/dict/findByDictCode/',
    //获取医院信息，根据名字
    HOSPITAL_INFO_URL='/hosp/hospital/findByHosname/'
}
//获取已有的医院数据
export const reqGetHospital = (page:number,limit:number,hostype='',districtCode='')=>request.get<any,AllHospital>(API.HOSPITAL_URL+`${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`)
//获取医院等级与地区
export const reqGetHospitalLevel =(dictCode:string)=>request.get<any,HospitalLevelData>(API.HOSPITAL_LEVEL_URL+dictCode)
//根据名字获取医院信息
export const reqGetHospitalInfo = (hosname:string)=>request.get<any,HospitalInfo>(API.HOSPITAL_INFO_URL+hosname)